from aiogram_dialog import DialogManager
from sqlalchemy.ext.asyncio import AsyncSession

from app.config import Settings


async def get_user_info(
    db_session: AsyncSession, dialog_manager: DialogManager, **kwargs
):
    user_id: int = dialog_manager.middleware_data["event_from_user"].id
    config: Settings = dialog_manager.middleware_data["config"]

    return {
        "is_admin": user_id in config.tg_bot.admin_ids,
    }
